﻿using System;
using System.Windows.Controls;
using System.Windows.Ria;
using System.Windows.Threading;
using TheOliver.DigitalSignage.Client.Interfaces;

namespace TheOliver.DigitalSignage.Client.Screens
{
    public partial class DefaultAgenda : UserControl, IInteractiveSlide
    {
        public DefaultAgenda()
        {
            InitializeComponent();

            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 5);
            timer.Tick += (s, e) =>
                {
                    timer.Stop();
                    OnFinished();
                };
        }

        #region ISlide Members

        public event EventHandler Finished;
        private void OnFinished()
        {
            if (Finished != null)
            {
                Finished(this, EventArgs.Empty);
            }
        }

        public int DisplayDuration
        {
            get { return Configuration.DefaultDisplayDuration; }
        }

        public bool HasContent
        {
            get { return true; }
        }

        #endregion

        #region IAgenda Members

        private EntitySet<AdminApp.Web.AllSlots> _slots;
        public EntitySet<AdminApp.Web.AllSlots> Slots
        {
            get { return _slots; }
            set { _slots = value; }
        }
        

        #endregion

        #region IAgenda Members


        public void Start()
        {
            ShowItems();
        }

        private void ShowItems()
        {
        }

        #endregion
    }
}
